package cn.itamt.stars.base {
	import cn.itamt.stars.PlanetStar;
	import cn.itamt.stars.StarSystem;
	import cn.itamt.stars.StaticStar;
	import cn.itamt.stars.base.IStar;
	
	import flash.display.DisplayObjectContainer;
	import flash.geom.Rectangle;	

	public class StarStyle {
		public var starType : String;
		public var rendererClass : Class;
		public var maxNum : uint;
		public var remainNum : uint;

		public function StarStyle(starType : String, rendererClass : Class, maxNum : uint = 500) : void {
			this.starType = starType;
			this.rendererClass = rendererClass;
			this.maxNum = remainNum = maxNum;
		}

		public function buildStar(rect : Rectangle, container : DisplayObjectContainer) : IStar {
			var star : IStar;
			switch(starType) {
				case StarSystem.STAR_TYPE_PLANET:
					star = new PlanetStar();
					break;
				case StarSystem.STAR_TYPE_STATIC:
					star = new StaticStar();
					break;
			}
			star.build(rendererClass, rect, container);
		
			return star;
		}
	}
}
